package com.hanshunping.oop.extends_.practise1;

public class Computer {
    private String cpu;
    private int memory;
    private String disk;

    //getDetails方法用于返回computer的信息
    public String getDetails(){
        return "CPU: " + cpu + "\nMemory: " + memory + "\nDisk: " + disk;
    }

    public Computer(String cpu, int memory, String disk) {
        this.cpu = cpu;
        this.memory = memory;
        this.disk = disk;
    }

    public String getCpu() {
        return cpu;
    }

    public void setCpu(String cpu) {
        this.cpu = cpu;
    }

    public int getMemory() {
        return memory;
    }

    public void setMemory(int memory) {
        this.memory = memory;
    }

    public String getDisk() {
        return disk;
    }

    public void setDisk(String disk) {
        this.disk = disk;
    }
}
